:css
  a {
    color: white;
  }

  h4 {
    font-weight:900;
  }

#root-pic{style: "width: 1280px; margin-bottom: 0px"}
  #carousel-example-generic.carousel.slide{"data-ride" => "carousel", "data-interval" => 4000}
    %ol.carousel-indicators
      - Carousel.where(status: 1).order('order_num asc').each_with_index do |pic, index|
        %li{class: index == 0 ? 'active' : '', data: {slide_to: index, target: "#carousel-example-generic"}}
    .carousel-inner.img-rounded{:role => "listbox"}
      - Carousel.where(status: 1).order('order_num asc').each_with_index do |pic, index|
        .item{style: "width: 100%; height: 460px;", class: index == 0 ? 'active' : ''}
          = link_to pic.http_picture_link do
            %img{src: pic.picture_src.try(:url), style: "width: 1280px; height: 720px"}
          .carousel-caption
    %a.left.carousel-control{"data-slide" => "prev", :href => "#carousel-example-generic", :role => "button"} Prev
    %a.right.carousel-control{"data-slide" => "next", :href => "#carousel-example-generic", :role => "button"} Next

#main_area_div{style: " height: auto; margin-top: 0px;"}
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 新闻动态
    %hr{style: "background-color:#f0bc81"}
    %div{style: "height: 450px; width: 900px; border-radius:5px;"}
      - Post.with_plate_id('news').active_posts.limit(5).each_with_index do |news, index|
        - if index == 0
          .row
            .col-xs-4
              %img{src: news.cover_src.try(:url), width: '300px', height: '200px'}
            .col-xs-8
              = link_to controller: 'home_pages', action: 'post_view', id: news.id do
                %h4= news.title
          %br
        - else
          = link_to news.title, controller: 'home_pages', action: 'post_view', id: news.id
          .pull-right= news.created_at.strftime("%Y-%m-%d")
          %hr{style: "height: 1px"}
  %br
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 项目介绍
    %hr
    - immigration_projects = Post.with_plate_id('immigration_project').active_posts.limit(4)
    .row
      - immigration_projects.each do |immigration_project|
        = link_to controller: 'home_pages', action: 'post_view', id: immigration_project.id do
          %div{class: "col-xs-#{12/immigration_projects.count}", style: "margin: 5px;height: 450px; width: #{900/immigration_projects.count}px; background:url(#{immigration_project.cover_src.try(:url)}); background-size:cover; border-radius:5px;"}
            %h4{style: "color: #f0bc81"}= immigration_project.title

  %br
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 关于爱尔兰
    %hr
    - about_irelands = Post.with_plate_id('about_ireland').active_posts.limit(4)
    .row
      - about_irelands.each do |about_ireland|
        = link_to controller: 'home_pages', action: 'post_view', id: about_ireland.id do
          %div{class: "col-xs-#{12/about_irelands.count}", style: "margin: 5px;height: 450px; width: #{900/about_irelands.count}px; background:url(#{about_ireland.cover_src.try(:url)}); background-size:cover; border-radius:5px;"}
            %h4{style: "color: #f0bc81"}= about_ireland.title

  %br
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 关于基恩
    %hr
    - about_keanes = Post.with_plate_id('about_keane').active_posts.limit(4)
    .row
      - about_keanes.each do |about_keane|
        = link_to controller: 'home_pages', action: 'post_view', id: about_keane.id do
          %div{class: "col-xs-#{12/about_keanes.count}", style: "margin: 5px;height: 450px; width: #{900/about_keanes.count}px; background:url(#{about_keane.cover_src.try(:url)}); background-size:cover; border-radius:5px;"}
            %h4{style: "color: #f0bc81"}= about_keane.title

  %br
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 合作伙伴
    %hr
    - partners = Post.with_plate_id('partner').active_posts.limit(6)
    .row
      - partners.each do |partner|
        = link_to controller: 'home_pages', action: 'post_view', id: partner.id do
          %div{class: "col-xs-#{12/partners.count}", style: "margin: 5px;height: 450px; width: #{900/partners.count}px; background:url(#{partner.cover_src.try(:url)}); background-size:cover; border-radius:5px;"}
            %h4{style: "color: #f0bc81"}= partner.title

  %br
  %div{style: "margin:0 auto; width: 920px;"}
    %h3 关于我们
    %hr
    - about_uss = Post.with_plate_id('about_us').active_posts.limit(6)
    .row
      - about_uss.each do |about_us|
        = link_to controller: 'home_pages', action: 'post_view', id: about_us.id do
          %div{class: "col-xs-#{12/about_uss.count}", style: "margin: 5px;height: 450px; width: #{900/about_uss.count}px; background:url(#{about_us.cover_src.try(:url)}); background-size:cover; border-radius:5px;"}
            %h4{style: "color: #f0bc81"}= about_us.title




